package com.chinacoal.microservice.api;

import javax.validation.Valid;

import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.baomidou.mybatisplus.plugins.Page;
import com.chinacoal.microservice.api.fallback.AgentClientFallback;
import com.chinacoal.microservice.model.wofkflow.QueryAgentParam;
import com.chinacoal.microservice.model.wofkflow.entity.AgentEntity;
import com.chinacoal.microservice.util.result.Result;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

/**  
 * @Package: com.chinacoal.microservice.api.AgentClient
 * @ClassName: AgentClient
 * @ClassDesc: 审批代理Client
 * @Createby: sunh
 * @CreatedDate: 2019-11-28 09:25:53
 */  
@Api(tags={"代理审批授权管理"})
@FeignClient(name = "ccms-workflow", configuration = FeignAutoConfiguration.class, fallback = AgentClientFallback.class)
public interface AgentClient {
	
    /**  
     * @Package: com.chinacoal.microservice.api.AgentClient.findList
     * @MethodName: findList
     * @MethodDesc: 查询代理审批授权列表
     * @ParamList: {
     *				 @param page
     *				 @param pageSize
     *				 @param param
     *			   }
     * @Return: Result<Object>
     * @Createby: sunh
     * @CreatedDate: 2019-12-15 14:36:21
     */ 
    @ApiOperation(value = "查询代理审批授权列表")
    @ApiImplicitParams({
        @ApiImplicitParam(paramType="path", name = "page", value = "当前页", required = true, dataType = "int"),
        @ApiImplicitParam(paramType="path", name = "pageSize", value = "每页记录数", required = true, dataType = "int")
    })
   @PostMapping("/workflow/agent/findList/{page}/{pageSize}")
   public Result<Page<AgentEntity>> findList(@PathVariable(value = "page",required = true) int page, 
		   									 @PathVariable(value = "pageSize",required = true) int pageSize, 
		   									 @Valid @RequestBody QueryAgentParam param);
	

    /**  
     * @Package: com.chinacoal.microservice.api.AgentClient.findOne
     * @MethodName: findOne
     * @MethodDesc: 查询代理审批授权详情信息
     * @ParamList: {
     *				 @param agentId
     *			   }
     * @Return: Result<Object>
     * @Createby: sunh
     * @CreatedDate: 2019-12-15 14:36:32
     */ 
    @ApiOperation(value = "查询代理审批授权详情信息")
    @ApiImplicitParams({
        @ApiImplicitParam(paramType="path", name = "agentId", value = "agentId", required = true, dataType = "Long")
    })
    @GetMapping("/workflow/agent/{agentId}")
    public Result<AgentEntity> findOne(@PathVariable("agentId") Long agentId);
	
    /**  
     * @Package: com.chinacoal.microservice.api.AgentClient.insert
     * @MethodName: insert
     * @MethodDesc: 新增代理审批授权
     * @ParamList: {
     *				 @param agentEntity
     *			   }
     * @Return: Result<Object>
     * @Createby: sunh
     * @CreatedDate: 2019-12-15 14:36:56
     */ 
    @ApiOperation(value = "新增代理审批授权")
    @PostMapping("/workflow/agent")
	public Result<Object> insert(@Valid @RequestBody AgentEntity agentEntity);
    
    /**  
     * @Package: com.chinacoal.microservice.api.AgentClient.update
     * @MethodName: update
     * @MethodDesc: 修改代理审批授权
     * @ParamList: {
     *				 @param agentEntity
     *			   }
     * @Return: Result<Object>
     * @Createby: sunh
     * @CreatedDate: 2019-12-15 14:37:11
     */ 
    @ApiOperation(value = "修改代理审批授权")
    @PutMapping("/workflow/agent")
    public Result<Object> update(@Valid @RequestBody AgentEntity agentEntity);
    
    /**  
     * @Package: com.chinacoal.microservice.api.AgentClient.delete
     * @MethodName: delete
     * @MethodDesc: 删除代理审批授权
     * @ParamList: {
     *				 @param idArray
     *			   }
     * @Return: Result<Object>
     * @Createby: sunh
     * @CreatedDate: 2019-12-15 14:38:13
     */ 
    @ApiOperation(value = "删除代理审批授权")
    @DeleteMapping("/workflow/agent/{agentId}")
	Result<Object> delete(@PathVariable("agentId") Long agentId);
    
    /**  
     * @Package: com.chinacoal.microservice.api.AgentClient.deleteItem
     * @MethodName: deleteItem
     * @MethodDesc: 删除代理审批授权行信息
     * @ParamList: {
     *				 @param idArray
     *			   }
     * @Return: Result<Object>
     * @Createby: sunh
     * @CreatedDate: 2019-12-15 14:38:13
     */ 
    @ApiOperation(value = "删除代理审批授权行信息")
    @DeleteMapping("/workflow/agent/item/{agentItemId}")
	Result<Object> deleteItem(@PathVariable("agentItemId") Long agentItemId);
}
